<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    
    
    <h:head> 
        <title>Users Page</title>
    </h:head>
    
    
    <h:body>
        
        <div>
            <h4>Logged user: #{userController.name.email} <h:link outcome="#{loginBean.logout()}" value="logout" /> </h4>
        </div>
        
        <div>
            <h:form>
    <p:growl id="messages" showDetail="true" />
 
    <h:panelGrid columnClasses="value">
        <h3 style="margin-top: 0">Event Calendar</h3>
        <p:schedule id="schedule" value="#{scheduleView.eventModel}" widgetVar="myschedule" timeZone="GMT+1">
 
            <p:ajax event="dateSelect" listener="#{scheduleView.onDateSelect}" update="eventDetails" oncomplete="PF('eventDialog').show();" />
            <p:ajax event="eventSelect" listener="#{scheduleView.onEventSelect}" update="eventDetails" oncomplete="PF('eventDialog').show();" />
            <p:ajax event="eventMove" listener="#{scheduleView.onEventMove}" update="messages" />
            <p:ajax event="eventResize" listener="#{scheduleView.onEventResize}" update="messages" />
 
        </p:schedule>
       
        
    </h:panelGrid>
 
    <p:dialog widgetVar="eventDialog" header="Event Details" showEffect="clip" hideEffect="clip">
        <h:panelGrid id="eventDetails" columns="2">
            <h:outputLabel for="title" value="Title:" />
            <p:inputText id="title" value="#{scheduleView.event.title}" required="true" />
 
            <h:outputLabel for="from" value="From:" />
            <p:inputMask id="from" value="#{scheduleView.event.startDate}" mask="99/99/9999">
                <f:convertDateTime pattern="dd/MM/yyyy" timeZone="GMT+1"/>
            </p:inputMask>
 
            <h:outputLabel for="to" value="To:" />
            <p:inputMask id="to" value="#{scheduleView.event.endDate}" mask="99/99/9999">
                <f:convertDateTime pattern="dd/MM/yyyy" timeZone="GMT+1"/>
            </p:inputMask>
             
            <h:outputLabel for="desc" value="Description:" />
            <p:inputTextarea id="desc" rows="6" cols="33" value="#{scheduleView.event.description}"/>
             
            <h:outputLabel for="vis" value="Public:" />
            <p:selectBooleanButton id="vis" value="#{scheduleView.event.editable}" onLabel="Yes" offLabel="No" style="width:60px" />
           
                     
            <p:commandButton type="reset" value="Reset" />
            <p:commandButton id="addButton" value="Save" actionListener="#{scheduleView.addEvent}" oncomplete="PF('myschedule').update();PF('eventDialog').hide();" />
        </h:panelGrid>
    </p:dialog>    
   
            </h:form>
 

  <style type="text/css">
    .value {
        width: 1000px;
      }
   </style>
            
            
        </div>
            
        
        
    </h:body>
</html>
